#include<bits/stdc++.h>

using namespace std;

int main() {
    freopen("G.in", "r", stdin);

    char s[1000];
    while (fgets(s, 999, stdin)) {
        if (s[strlen(s) - 1] == '\n')
            s[strlen(s) - 1] = 0;
        if (islower(s[0]))
            s[0] = toupper(s[0]);
        for (int i = 1, n = strlen(s); i < n; i++) {
            if (islower(s[i]) && !isalpha(s[i - 1])) {
                s[i] = toupper(s[i]);
            }
        }

        cout << s << endl;
    }

    return 0;
}
